package com.xxyf.tools;

import lombok.Getter;
import lombok.Setter;

/**
 * @Author 小小怡飞
 * @Date 2022/8/24 3:16
 * @Version JDK 8
 */
@Getter
@Setter
public class Rest {
    private Object data;
    private String msg;
    private Integer code;
    public Rest(){
        this.msg=Code.succeed.getMag();
        this.code=Code.succeed.getCode();
        data=null;
    }
    public Rest(Code code){
        this.msg=code.getMag();
        this.code=code.getCode();
        data=null;
    }
    public Rest(Object data){
        this.msg=Code.succeed.getMag();
        this.code=Code.succeed.getCode();
        this.data=data;
    }
    public Rest(Object data,String msg){
        this.msg=msg;
        this.code=Code.succeed.getCode();
        this.data=data;
    }
    public Rest(Code code,String msg){
        this.msg=msg;
        this.code=code.getCode();
        this.data=null;
    }

    public Rest(Code code,Object data){
        this.msg=code.getMag();
        this.code=code.getCode();
        this.data=data;
    }
    public Rest(Code code,Object data,String msg){
        this.msg=msg;
        this.code=code.getCode();
        this.data=data;
    }
    public Rest(Integer code,Object data,String msg){
        this.msg=msg;
        this.code=code;
        this.data=data;
    }

}
